<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        /**方法一**/
        /*.dad{*/
            /*position: relative;*/
            /*width: 500px;*/
            /*height: 300px;*/
            /*border:1px solid #ddd;*/
        /*}*/
        /*.son{*/
            /*background: #f00;*/
            /*width: 100px;*/
            /*height: 100px;*/
            /*position: absolute;*/
            /*margin: auto;*/
            /*top: 0;*/
            /*right: 0;*/
            /*bottom: 0;*/
            /*left: 0;*/
            /*text-align: center;*/

        /*}*/

        /**方法二**/
        .dad{
            position: relative;
            width: 500px;
            height: 300px;
            border:1px solid #ddd;
        }
        .son{
            background: #f00;
            width: 100px;
            height: 100px;
            position: absolute;
            top: 50%;
            left: 50%;
            /*margin-top: -50px;*/
            /*margin-left: -50px;*/
            transform: translate3D(-50%,-50%,0);
            text-align: center;

        }
    </style>
</head>
<body>
    <div class="dad">
        <div class="son">
            <span>
                发的说法三dsaf十大
            </span>

        </div>
    </div>
</body>
</html>